<?php


namespace app\shop\validate;


use think\Validate;

class OrderValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     * @var array
     */
    protected $rule = [
        'mobile' => 'require',
        'order_name' => 'require',
        'order_amount' => 'require',
//        'due_in_amount' => 'require',
        'design_need' => 'require',
        'design_type' => 'require',
        'business_type' => 'require',
        'program_id' => 'require',
//        'order_status' => 'require',
        'due_in_refund' => 'require',
        'pay_type' => 'require',
        'is_urgent' => 'require',
        'delivery_time' => 'require',
        'id' => 'require',
        'replenish_need' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     * @var array
     */
    protected $message = [
        'mobile.require' => '客户编号不能为空',
        'order_name.require' => '订单名称不能为空',
        'order_amount.require' => '订单金额不能为空',
        'due_in_amount.require' => '代收款金额不能为空',
        'design_need.require' => '设计需求不能为空',
        'design_type.require' => '请选择设计类型',
        'business_type.require' => '请选择业务类型',
        'program_id.require' => '请选择设计项目',
        'order_status.require' => '请选择订单状态',
        'invoice_company.require' => '开票对应公司不能为空',
        'invoice_amount.require' => '开票金额不能为空',
        'invoice_company_info.require' => '开票公司信息不能为空',
        'invoice_name.require' => '开票人姓名不能为空',
        'invoice_no.require' => '税号不能为空',
        'invoice_address.require' => '注册地址不能为空',
        'invoice_tel.require' => '联系电话不能为空',
        'invoice_bank.require' => '开户行不能为空',
        'invoice_bank_code.require' => '开户行行号不能为空',
        'invoice_bank_card.require' => '银行账号不能为空',
        'due_in_refund.require' => '请选择代收款返还',
        'pay_type.require' => '请选择付款方式',
        'is_urgent.require' => '请选择是否加急',
        'delivery_time.require' => '请选择交稿时间',
        'id.require' => '订单id不能为空',
        'replenish_need.require' => '补充需求不能为空',
    ];
    protected $scene = [
        'add' => ['mobile', 'order_name', 'order_amount'],
        'edit' => ['id', 'mobile', 'order_name', 'order_amount'],
        'supplement' => ['id'],
    ];
}